package com.design.patterns.strategy;

/**
 * @author yuexizhao9159@gmail.com
 * @version V1.0
 * @since 2.2.0 2021/3/1 0001 20:35
 */
public class UseStraegy {
    public static void main(String[] args) {
        /**
         * 可以根据实行情况选择相关策略
         */
        Context context;

        System.out.println("-----------执行策略1-------------");
        context = new Context(new IStrategy1());
        context.operate();
        System.out.println("\n\n\n\n\n\n\n\n");


        System.out.println("-----------执行策略2-------------");
        context = new Context(new IStrategy2());
        context.operate();
        System.out.println("\n\n\n\n\n\n\n\n");


        System.out.println("-----------执行策略3-------------");
            context = new Context(new IStrategy3());
        context.operate();
        System.out.println("\n\n\n\n\n\n\n\n");



    }
}
